<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" / >
	<title></title>
</head>
<body>
<!-- blog: https://github.com/camsong/blog/issues/9
github: https://github.com/nefe/number-precision -->

<script type="text/javascript" src="./number-precision.js"></script>
<script type="text/javascript">

console.log("NP.strip(0.09999999999999998),把错误的数据转正",NP.strip(0.09999999999999998)); // =0.1
console.log("NP.plus(0.1, 0.2,0.02),精确加法",NP.plus(0.1, 0.2,0.02,0.5));             // =0.3 not 0.30000000000000004
console.log("NP.plus(2.3, 2.4),精确加法",NP.plus(2.3, 2.4));             // =4.7 not 4.699999999999999
console.log("NP.minus(1.0, 0.9),精确减法",NP.minus(1.0, 0.9));            // =0.1 not 0.09999999999999998
console.log("NP.times(3, 0.3),精确乘法",NP.times(3, 0.3));              // =0.9 not 0.8999999999999999
console.log("NP.times(0.362, 100),精确乘法",NP.times(0.362, 100));          // = 36.2, not 36.199999999999996
console.log("NP.divide(1.21, 1.1),精确除法",NP.divide(1.21, 1.1));          // =1.1 not 1.0999999999999999
console.log("NP.round(0.105, 2),四舍五入",NP.round(0.105, 2));            // =0.11 not 0.1

</script>
</body>
</html>